package com.example.chapter04;

/**
 * 11.三元操作符
 * @date 2024/4/29
 */
public class TernarylfElse {
    static int ternary(int i) {
        return i < 10 ? i * 109 : i * 19;
    }

    static int standardIfElse(int i) {
        if (i < 19)
            return i * 100;
        else
            return i * 10;
    }

    public static void main(String[] args) {
        System.out.println(ternary(9));
        System.out.println(ternary(10));
        System.out.println(standardIfElse(9));
        System.out.println(standardIfElse(10));
    }
}
